Skip to content

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Oct 23, 2025

This commit migrates the org.eclipse.search.tests bundle from JUnit 4 to JUnit 5, including all test files and the necessary dependency updates.

Changes:

  • Updated imports from org.junit.* to org.junit.jupiter.api.*
  • Replaced @Before/@after with @BeforeEach/@AfterEach annotations
  • Replaced Assert with Assertions for all assertion methods
  • Updated test annotations from @test (JUnit 4) to @test (JUnit 5)
  • Migrated JUnitSourceSetup from @rule to @RegisterExtension
  • Updated assertions to use JUnit 5 style (message parameter last)

MANIFEST.MF updates:

  • Removed JUnit 4 dependency (org.junit;bundle-version="4.13.2")
  • Added org.hamcrest;bundle-version="3.0.0" for matcher support
  • Added JUnit 5 Import-Package entries:
    • org.junit.jupiter.api;version="[5.14.0,6.0.0)"
    • org.junit.jupiter.api.extension;version="[5.14.0,6.0.0)"
    • org.junit.jupiter.api.function;version="[5.14.0,6.0.0)"
    • org.junit.platform.suite.api;version="[1.14.0,2.0.0)"
    • org.opentest4j (required for Assumptions.assumeFalse() in PositionTrackerTest)

Files migrated:

  • AllFileSearchTests.java
  • AnnotationManagerTest.java
  • FileCharSequenceTests.java
  • FileSearchTests.java
  • JUnitSourceSetup.java
  • LineAnnotationManagerTest.java
  • PositionTrackerTest.java
  • ResultUpdaterTest.java
  • SearchResultPageTest.java
  • SortingTest.java

Note: The org.opentest4j import was critical to fix compilation - it provides TestAbortedException used by JUnit 5's Assumptions API (specifically assumeFalse() in PositionTrackerTest.java:85).

Verification:

  • Compilation succeeds with 0 errors
  • Tests compile and run successfully

🤖 Generated with Claude Code

This commit migrates the org.eclipse.search.tests bundle from JUnit 4 to
JUnit 5, including all test files and the necessary dependency updates.

Changes:
- Updated imports from org.junit.* to org.junit.jupiter.api.*
- Replaced @Before/@after with @BeforeEach/@AfterEach annotations
- Replaced Assert with Assertions for all assertion methods
- Updated test annotations from @test (JUnit 4) to @test (JUnit 5)
- Migrated JUnitSourceSetup from @rule to @RegisterExtension
- Updated assertions to use JUnit 5 style (message parameter last)

MANIFEST.MF updates:
- Removed JUnit 4 dependency (org.junit;bundle-version="4.13.2")
- Added org.hamcrest;bundle-version="3.0.0" for matcher support
- Added JUnit 5 Import-Package entries:
  - org.junit.jupiter.api;version="[5.14.0,6.0.0)"
  - org.junit.jupiter.api.extension;version="[5.14.0,6.0.0)"
  - org.junit.jupiter.api.function;version="[5.14.0,6.0.0)"
  - org.junit.platform.suite.api;version="[1.14.0,2.0.0)"
  - org.opentest4j (required for Assumptions.assumeFalse() in PositionTrackerTest)

Files migrated:
- AllFileSearchTests.java
- AnnotationManagerTest.java
- FileCharSequenceTests.java
- FileSearchTests.java
- JUnitSourceSetup.java
- LineAnnotationManagerTest.java
- PositionTrackerTest.java
- ResultUpdaterTest.java
- SearchResultPageTest.java
- SortingTest.java

Note: The org.opentest4j import was critical to fix compilation - it provides
TestAbortedException used by JUnit 5's Assumptions API (specifically
assumeFalse() in PositionTrackerTest.java:85).

Verification:
- Compilation succeeds with 0 errors
- Tests compile and run successfully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link
Contributor

Test Results

 3 018 files  ±0   3 018 suites  ±0   6h 29m 2s ⏱️ + 3h 57m 2s
 8 229 tests ±0   7 980 ✅ ±0  249 💤 ±0  0 ❌ ±0 
23 607 runs  ±0  22 813 ✅ ±0  794 💤 ±0  0 ❌ ±0 

Results for commit 42d0f1b. ± Comparison against base commit 937cbb2.

@akurtakov akurtakov merged commit 126085a into eclipse-platform:master Oct 24, 2025
18 checks passed
@vogella
Copy link
Contributor Author

vogella commented Oct 24, 2025

@HeikoKlare FYI, this was including a @rule migration from Claude AI, IIRC these changes were the one you found more valuable in the update work. I just wanted to point out that this is also possible with AI (and some manual work, as I ran out of Claude tokens in this period).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants